<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>给组件绑定原生事件</title>
  <script src="../static/vue.js"></script>
</head>
<body>
<div id="root">
  <child @click.native="handleClick"></child>
</div>
<script>
  Vue.component('child', {
    template: '<div>Child</div>'/*,
    // template: '<div @click="handleChildClick">Child</div>'/*,
    methods: {
      handleChildClick: function () {
        this.$emit('click')
      }
    }*/
  })

  var vm = new Vue({
    el: '#root',
    methods: {
      handleClick: function () {
        alert('handleClick')
      }
    }
  })
</script>
</body>
</html>
